package com.campus.properties;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * openAI properties
 *
 * @author TaiZai
 * @data 2024/11/9 13:05
 */
@Component
@ConfigurationProperties(prefix = "campus.ai")
@Data
public class AIProperties {

    // openAI 配置
    private OpenAI openAI;

    // closeAI 配置
    private CloseAI closeAI;

    // moonshotAI 配置
    private MoonshotAI moonshotAI;

    @Data
    public static class OpenAI {
        private String apiKey;
        private String cloudflareAccountId;
        private String cloudflareGatewayId;
        private String cloudflareBaseUrl;

        public String getCloudflareBaseUrl() {
            return cloudflareBaseUrl + "/" + cloudflareAccountId + "/" + cloudflareGatewayId + "/openai";
        }
    }

    @Data
    public static class CloseAI {
        private String apiKey;
        private String BaseUrl;
    }

    @Data
    public static class MoonshotAI {
        private String apiKey;
        private String baseUrl;
    }
}
